#include <iostream>
#include <map>
using namespace std;

// 已知

// 未知

map<int, int> m;

int main()
{
    for (int i = 0, x; i < 7; ++i)
    {
        cin >> x;
        m[x]++;
    }
    auto it1 = m.begin();
    auto it2 = m.begin();
    int cnt = 0;
    if (m.size() > 1)
    {
        while (it1 != m.end())
        {
            if (it1->second >= 3)
            {
                cnt++;
                break;
            }
            ++it1;
        }

        while (it2 != m.end())
        {
            if (it2->second >= 2 and it2 != it1)
            {
                cnt++;
                break;
            }
            ++it2;
        }
    }
    if (cnt == 2)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}